package com.ruoyi.operationAdministration.service.impl;

import java.util.List;

import com.ruoyi.operationAdministration.vo.EquOperationMaintenanceManageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.operationAdministration.mapper.EquOperationMaintenanceManageMapper;
import com.ruoyi.operationAdministration.domain.EquOperationMaintenanceManage;
import com.ruoyi.operationAdministration.service.IEquOperationMaintenanceManageService;

/**
 * 设备运维管理Service业务层处理
 *
 * @author lth
 * @date 2023-12-21
 */
@Service
public class EquOperationMaintenanceManageServiceImpl implements IEquOperationMaintenanceManageService
{
    @Autowired
    private EquOperationMaintenanceManageMapper equOperationMaintenanceManageMapper;

    /**
     * 查询设备运维管理
     *
     * @param id 设备运维管理主键
     * @return 设备运维管理
     */
    @Override
    public EquOperationMaintenanceManage selectEquOperationMaintenanceManageById(Long id)
    {
        return equOperationMaintenanceManageMapper.selectEquOperationMaintenanceManageById(id);
    }

    /**
     * 查询设备运维管理列表
     *
     * @param equOperationMaintenanceManage 设备运维管理
     * @return 设备运维管理
     */
    @Override
    public List<EquOperationMaintenanceManage> selectEquOperationMaintenanceManageList(EquOperationMaintenanceManage equOperationMaintenanceManage)
    {
        return equOperationMaintenanceManageMapper.selectEquOperationMaintenanceManageList(equOperationMaintenanceManage);
    }

    /**
     * 新增设备运维管理
     *
     * @param equOperationMaintenanceManage 设备运维管理
     * @return 结果
     */
    @Override
    public int insertEquOperationMaintenanceManage(EquOperationMaintenanceManage equOperationMaintenanceManage)
    {
        return equOperationMaintenanceManageMapper.insertEquOperationMaintenanceManage(equOperationMaintenanceManage);
    }

    /**
     * 修改设备运维管理
     *
     * @param equOperationMaintenanceManage 设备运维管理
     * @return 结果
     */
    @Override
    public int updateEquOperationMaintenanceManage(EquOperationMaintenanceManage equOperationMaintenanceManage)
    {
        return equOperationMaintenanceManageMapper.updateEquOperationMaintenanceManage(equOperationMaintenanceManage);
    }

    /**
     * 批量删除设备运维管理
     *
     * @param ids 需要删除的设备运维管理主键
     * @return 结果
     */
    @Override
    public int deleteEquOperationMaintenanceManageByIds(Long[] ids)
    {
        return equOperationMaintenanceManageMapper.deleteEquOperationMaintenanceManageByIds(ids);
    }

    /**
     * 删除设备运维管理信息
     *
     * @param id 设备运维管理主键
     * @return 结果
     */
    @Override
    public int deleteEquOperationMaintenanceManageById(Long id)
    {
        return equOperationMaintenanceManageMapper.deleteEquOperationMaintenanceManageById(id);
    }

    @Override
    public List<EquOperationMaintenanceManage> listByVo(EquOperationMaintenanceManageVo vo) {
        String equipmentName = vo.getEquipmentName();
        if (equipmentName!=null){
            List<EquOperationMaintenanceManage> equOperationMaintenanceManageList = equOperationMaintenanceManageMapper.listByVo(equipmentName);
            return equOperationMaintenanceManageList;
        }else {
            return equOperationMaintenanceManageMapper.selectEquOperationMaintenanceManageList(null);
        }

    }
}
